package pieces;

import core.Color;
import java.util.List;

import core.Board;
import core.Move;
import core.Position;

/**
 * Class: Piece
 * Responsibilities: Abstract class containing information about the color
 * and position of itself. legalmove, possiblemoves and moves are abstract
 * methods which must be implemented in subclasses.
 * Collaborators: Position.
 * @author Tobias
 *
 */
public abstract class Piece {
	Position p;
	Color color;

	public abstract List<Move> possibleMoves(Board board);
	abstract void move();

	public Piece(Color color, Position p) {
		this.color = color;
		this.p = p;
	}

	public boolean isWhite() {
		return color.equals(Color.WHITE);
	}
	public Position getP() {
		return p;
	}
	public void setP(Position p) {
		this.p = p;
	}
	public abstract boolean legalMove(Move m, Board board);

}
